{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The model is saved.\n"
     ]
    }
   ],
   "source": [
    "from __future__ import absolute_import\n",
    "from __future__ import division\n",
    "from __future__ import print_function\n",
    "from __future__ import unicode_literals\n",
    "\n",
    "import onnx\n",
    "import os\n",
    "\n",
    "\n",
    "# Preprocessing: load the old model\n",
    "old_model_path = os.path.join('resources', 'single_relu.onnx')\n",
    "onnx_model = onnx.load(old_model_path)\n",
    "\n",
    "# Preprocessing: get the path to the saved model\n",
    "new_model_path = os.path.join('resources', 'single_relu_new.onnx')\n",
    "\n",
    "# Save the ONNX model\n",
    "onnx.save(onnx_model, new_model_path)\n",
    "\n",
    "print('The model is saved.')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
